#include<iostream>
#include<cmath>
using namespace std;
class Complex
{
public:
    void init(double r,double i)
    {
        real=r;
        imag=i;
    }

    void print()
    {
        cout<< real <<" + " << imag <<"i\n";
    }

    double abscomplex( )
    {
        return sqrt(real*real+imag*imag);
    }
    
private:
    double real;
    double imag;
};

int main()
{
    Complex cm1;
    cm1.init(-1.5,2);
    cm1.print();
    cout<<"abs of cm1 is "<<cm1.abscomplex()<<endl;
    return 0;
}